package com.ztgf.logistics.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.ztgf.logistics.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ztgf.logistics.mapper.CourierCompanyMapper;
import com.ztgf.logistics.models.service.ICourierCompanyService;
import com.ztgf.logistics.models.bo.CourierCompanySaveBO;
import com.ztgf.logistics.models.dto.CourierCompanyDTO;

/**
 * 快递公司信息表控制器
 *
 * @author chenyu.wang
 * @Date 2020-06-29 11:09:27
 */
@DubboService
public class CourierCompanyServiceImpl extends ServiceImpl<CourierCompanyMapper, CourierCompanyDTO> implements ICourierCompanyService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(CourierCompanySaveBO saveBO) {
        CourierCompanyDTO dto = new CourierCompanyDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
